$(function(){
    lanrenzhijia(".drop-menu-effect");
});
function lanrenzhijia(_this){
    $(_this).each(function(){
        var $this = $(this);
        var theMenu = $this.find(".submenu");
        var tarHeight = theMenu.height();
        theMenu.css({height:0});
        $this.hover(
            function(){
                $(this).addClass("mj_hover_menu");
                theMenu.stop().show().animate({height:tarHeight},400);
            },
            function(){
                $(this).removeClass("mj_hover_menu");
                theMenu.stop().animate({height:0},400,function(){
                    $(this).css({display:"none"});
                });
            }
        );
    });
}
$(function () {
//    滚动导航
    $(window).scroll(function () {
        var scrollY = $(document).scrollTop();// 获取垂直滚动的距离，即滚动了多少

        if (scrollY > 170) { //如果滚动距离大于550px则隐藏，否则删除隐藏类
            $('.fixed-naver').addClass('hide-navers');
            $('#top-nav').addClass('hide-naver');
        }
        else {
            $('.fixed-naver').removeClass('hide-navers');
            $('#top-nav').removeClass('hide-naver');
        }
    });

//    切换tab
//     $('.navers').click(function () {
//         $('.navers').removeClass('naver-active');
//         $(this).addClass('naver-active');
//         var index = $(this).index();
//         $('.parts').addClass('part-list-none');
//         $('.parts').eq(index).removeClass('part-list-none');
//     })

//    二维码
    var tipsi;
    $(".code").hover(function () {
        tipsi = layer.tips('<img src="/Public/img/code.jpeg" style="width:100px;height:100px;">', this, {
            time: 0,
            tips: 3,
        });
    }, function () {
        layer.close(tipsi);
    });
//    轮播
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true,
        autoplay: 2500,
        autoplayDisableOnInteraction: false
    });
});
